package main.entity;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.constraints.Min;

@SuppressWarnings("serial")
@Entity
public class Boy implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	public static final String ID = "id";
	
	public static final String ADDRESS = "address";
	
	public static final String AGE = "age";

	public static final String NAME = "name";

	@Id
	@GeneratedValue
	private Integer id;
	
	private String name;
	
	private String address;
	
	@Min(value=18,message="未满18岁")
	private Integer age;
	
	public Boy(){}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getAge() {
		return age;
	}

	
	public String getAddress() {
		return address;
	}
	
	public void setAge(Integer age) {
		this.age = age;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public void setAddress(String address) {
		this.address=address;
	}
	
	public String toString() {
		return "Boy{"+
				"id="+ id +
				",name="+ name +
				",address=" + address + 
				", age=" + age +
				"}";
	}
	
}
